package org.jeecg.modules.health_records.emergency_contact.service.impl;

import org.jeecg.modules.health_records.emergency_contact.entity.EmergencyContactInfo;
import org.jeecg.modules.health_records.emergency_contact.mapper.EmergencyContactInfoMapper;
import org.jeecg.modules.health_records.emergency_contact.service.IEmergencyContactInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @Description: 紧急联系人信息表
 * @Author: jeecg-boot
 * @Date:   2025-06-25
 * @Version: V1.0
 */
@Service
public class EmergencyContactInfoServiceImpl extends ServiceImpl<EmergencyContactInfoMapper, EmergencyContactInfo> implements IEmergencyContactInfoService {
    @Autowired
    private EmergencyContactInfoMapper emergencyContactInfoMapper;

    /**按recordid查询**/
    @Override
    @Transactional(rollbackFor = Exception.class)
    public List<EmergencyContactInfo> queryByRecordId(EmergencyContactInfo emergencyContactInfo) {
        return emergencyContactInfoMapper.queryByRecordId(Long.valueOf(emergencyContactInfo.getRecordid()),emergencyContactInfo.getIdNumber());

    }
}
